package com.molichuxing.services.business.service;

import com.molichuxing.framework.dto.Paged;
import com.molichuxing.framework.exception.BizException;
import com.molichuxing.services.business.dto.request.modify.OrderScheduleAuditModifyDto;
import com.molichuxing.services.business.dto.request.modify.OrderScheduleOfflineModifyDto;
import com.molichuxing.services.business.dto.response.*;
import com.molichuxing.services.property.OrderTypeEnum;

import java.time.LocalDate;
import java.util.List;
import java.util.Map;

/**
 * @Author: renzhengyu
 * @Description: 还款组合服务
 * @Date: Created in 10:45 2019/8/19
 * @Modified By:
 **/
public interface OrderScheduleBizService {

    /**
     * 获取订单下未还款期数信息
     *
     * @param orderCode
     * @return
     */
    public List<OrderScheduleRelationBizDto> getOrderScheduleRelationBizDto(Long orderCode) throws Exception;


    /**
     * 获取经销商订单本期还款列表
     *
     * @param params
     * @param pageNum
     * @param pageSize
     * @return
     */
    public Paged<OrderScheduleCurrentPeriodBizDto> getOrderScheduleCurrentPeriodList(Map<String, Object> params, Integer pageNum, Integer pageSize) throws Exception;

    /**
     * 获取经销商订单逾期未还款列表
     *
     * @param params
     * @param pageNum
     * @param pageSize
     * @return
     */
    public Paged<OrderScheduleOverdueBizDto> getOrderScheduleOverdueList(Map<String, Object> params, Integer pageNum, Integer pageSize) throws Exception;


    /**
     * 获取还款流水信息详情-还款订单信息
     *
     * @param id
     * @return
     */
    public List<OrderScheduleDetailBizDto> getOrderScheduleDetailBizDtoById(List<Integer> id) throws Exception;

    /**
     * 根据排期ids查询还款订单信息
     *
     * @param ids 排期ids
     * @return
     */
    public List<OrderScheduleOfflineBizDto> getOrderScheduleOffline(List<Integer> ids);

    /**
     * 线下还款修改排期状态
     *
     * @param modifyDto
     * @return
     * @throws BizException
     */
    public Map<Integer, OrderScheduleOfflineBizDto> modifyOrderScheduleByOffline(
            OrderScheduleOfflineModifyDto modifyDto) throws BizException;

    /**
     * 还款计划-基础信息
     *
     * @param orderCode
     * @return
     */
    public OrderDealerDetailBasicBizDto getOrderDealerDetailBasicBizDto(Long orderCode) throws Exception;


    /**
     * 根据条件查询付款周期
     *
     * @param params
     * @return
     */
    public Map<LedgerRepaymentPeriodBizDto, String> getDealerRepaymentPeriod(List<LedgerRepaymentPeriodBizDto> params)
            throws Exception;

    /**
     * 审核驳回
     *
     * @return
     */
    public Boolean auditRejected(OrderScheduleAuditModifyDto orderScheduleAuditModifyDto);

    /**
     * 查询还款提醒消息
     *
     * @param payableDate 应还款日期
     * @param isAll       true:查询<payableDate，false：查询=payableDate
     * @param orderType   订单类型
     * @return
     */
    public List<OrderScheduleReminderBizDto> getReminder(LocalDate payableDate, boolean isAll, OrderTypeEnum orderType);

    /**
     * 获取用户逾期续加入黑名单信息
     *
     * @param payableDate 应还款日期
     * @return
     */
    public List<UserOverdueBlacklistBizDto> getUserOverdueBlacklist(LocalDate payableDate);

    /**
     * 计算逾期信息
     *
     * @param orderCode 订单号
     * @param date      计算日期
     * @return
     */
    OverdueBizDto getOverdue(Long orderCode, LocalDate date);
}
